package com.nebula.core.dsl.builder;

/**
 * @author zhangtao
 */
public interface GetSubgraphStatementBuilder extends StatementBuilder {

    interface GetSubgraphStatement extends GetSubgraphStart, GetSubgraphWithPropOut, GetSubgraphStepOut,
            GetSubgraphFromOut, GetSubgraphEdgeOut, GetSubgraphWhereOut, GetSubgraphYieldOut {

    }

    interface GetSubgraphStart extends GetSubgraphWithProp, GetSubgraphStep, GetSubgraphFrom {

    }

    interface GetSubgraphWithProp {
        /**
         * 是否展示边属性
         *
         * @param withProp
         * @return
         */
        GetSubgraphWithPropOut withProp(boolean withProp);
    }

    interface GetSubgraphWithPropOut extends GetSubgraphStep, GetSubgraphFrom {

    }

    interface GetSubgraphStep {
        /**
         * 检索步长
         *
         * @param steps
         * @return
         */
        GetSubgraphStepOut steps(int steps);

    }

    interface GetSubgraphStepOut extends GetSubgraphFrom {

    }

    interface GetSubgraphFrom {
        /**
         * 检索vid
         *
         * @param vids
         * @return
         */
        GetSubgraphFromOut from(Object... vids);

        /**
         * 检索使用引用变量
         *
         * @param reference
         * @return
         */
        GetSubgraphFromOut fromPipe(String reference);
    }

    interface GetSubgraphFromOut extends GetSubgraphEdge, GetSubgraphWhere, GetSubgraphYield,Build {

    }

    interface GetSubgraphEdge {
        /**
         * 检索入边类型
         *
         * @param edgeType
         * @return
         */
        GetSubgraphEdgeOut in(String... edgeType);

        /**
         * 检索出边类型
         *
         * @param edgeType
         * @return
         */
        GetSubgraphEdgeOut out(String... edgeType);

        /**
         * 检索双边类型
         *
         * @param edgeType
         * @return
         */
        GetSubgraphEdgeOut both(String... edgeType);
    }

    interface GetSubgraphEdgeOut extends GetSubgraphEdge, GetSubgraphWhere, GetSubgraphYield,Build {

    }


    interface GetSubgraphWhere {
        /**
         * 检索and条件
         *
         * @param key
         * @param operator
         * @param value
         * @return
         */
        GetSubgraphWhereOut and(String key, String operator, Object value);

        /**
         * 检索or条件
         *
         * @param key
         * @param operator
         * @param value
         * @return
         */
        GetSubgraphWhereOut or(String key, String operator, Object value);
    }

    interface GetSubgraphWhereOut extends GetSubgraphWhere, GetSubgraphYield, Build {
    }

    interface GetSubgraphYield {
        /**
         * 返回点和边
         *
         * @param vertexAlias
         * @param edgeAlias
         * @return
         */
        GetSubgraphYieldOut yield(String vertexAlias, String edgeAlias);

    }

    interface GetSubgraphYieldOut extends Build {

    }

}
